<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<th:block th:insert="~{include :: header('定时任务日志列表')}" />
	<th:block th:insert="~{include :: bootstrap-table-css}" />
</head>
<body class="hold-transition sidebar-mini">
	<div class="container-fluid mt-2  mb-2">
		<form id="data-form" class="form-inline">
			<input type="text" class="form-control mr-1" name="jobName" th:value="${job!=null?job.jobName:''}" placeholder="任务名称" />
			<select name="jobGroup" class="form-control mr-1" th:with="type=${@dict.getType('qrtz_job_group')}">
				<option value="">分组</option>
				<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{job.jobGroup}"></option>
			</select>
			<select name="status" class="form-control mr-1" th:with="type=${@dict.getType('qrtz_job_status')}">
				<option value="">状态</option>
				<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
			</select>
			<a class="btn btn-primary btn-rounded mr-1" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
			<a class="btn btn-warning btn-rounded mr-1" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
		</form>
		<div class="toolbar" id="toolbar" role="group">
			<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" hasPermission="monitor:job:remove">
				<i class="fa fa-remove"></i> 删除
			</a>
		</div>
		<table id="bootstrap-table" class="table-striped"></table>
	</div>
	<th:block th:insert="~{include :: footer}" />
	<th:block th:insert="~{include :: bootstrap-table-js}" />
	<script th:inline="javascript">
		var detailFlag = [[${@permission.hasPermi('monitor:job:detail')}]];
		var statusDatas = [[${@dict.getType('sys_common_status')}]];
		var groupDatas = [[${@dict.getType('qrtz_job_group')}]];
		var prefix = "/monitor/jobLog";

		$(function() {
		    var options = {
		        url: prefix + "/list.json",
		        detailUrl: prefix + "/detail/{id}",
		        removeUrl: prefix + "/remove.json",
		        sortName: "createTime",
		        sortOrder: "desc",
		        modalName: "调度日志",
		        columns: [{
		            checkbox: true
		        },
		        {
		            field: 'jobLogId',
		            title: '日志编号'
		        },
		        {
		            field: 'jobName',
		            title: '任务名称'
		        },
		        {
		            field: 'jobGroup',
		            title: '任务分组',
		            formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(groupDatas, value);
		            }
		        },
		        {
		            field: 'invokeTarget',
		            title: '调用目标字符串',
		            formatter: function(value, row, index) {
                    	return $.table.tooltip(value);
                    }
		        },
		        {
		            field: 'jobMessage',
		            title: '日志信息'
		        },
		        {
		            field: 'status',
		            title: '状态',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(statusDatas, value);
		            }
		        },
		        {
		            field: 'createTime',
		            title: '创建时间',
		            sortable: true
		        },
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		                var actions = [];
		                actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.jobLogId + '\')"><i class="fa fa-search"></i>详细</a>');
		                return actions.join('');
		            }
		        }]
		    };
		    $.table.init(options);
		});
	</script>
</body>
</html>